//
//  SWFeedbackReq.swift
//  SpeedPDF
//
//  Created by linhan on 16/6/23.
//  Copyright © 2016年 me. All rights reserved.
//

import Foundation
class SWFeedbackReq: SWBaseRequest
{
    var contact:String = ""
    var content:String = ""
    
    override init()
    {
        super.init()
        options.authorize = false
        options.format = .String
    }
    
    override var url:String
    {
        return "http://tj.m.jisupdf.com/ios/feedback.php"
    }
    
    override var params:Any?
    {
        return ["aver":UIDevice.currentDevice().systemVersion, "version":AppConfig.shared().version, "name":contact, "content":content]
    }
    
    override func onFinishLoadingWithString(_ data:String, cache:Bool)
    {
        if data == "1"
        {
            onAPISuccess(data, cache:cache)
        }
        else
        {
            onAPIFailed(NSError(domain: "", code: 0, userInfo: nil))
        }
    }
    
    
}
